-
Notifications
You must be signed in to change notification settings - Fork 1.3k
[supervisor] fix ports forwarding hangs issue #20841
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| sub := &Subscription{updates: make(chan []*api.PortsStatus, 5)} | ||
| var once sync.Once | ||
| sub.Close = func() error { | ||
| pm.mu.Lock() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sub.Close and updateState both need mutex, which makes a dead lock
| requests: make(chan *exposePortRequest, 30), | ||
| localExposedNotice: make(chan struct{}, 30), | ||
| // allow clients to submit 3000 expose requests without blocking | ||
| requests: make(chan *exposePortRequest, 3000), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ports expose requests more than 30 at the same time will make updateState hangs, and hold mutex forever
76d4f27 to
a720018
Compare
geropl
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code changes LGTM, tests are green ✔️
Thank you for this fix @mustard-mh ! 🙏
Description
Related Issue(s)
Fixes CLC-1313
How to test
for p in {1230..1270}; do python3 -m http.server $p & donegp ports listDocumentation
Preview status
Gitpod was successfully deployed to your preview environment.
Build Options
Build
Run the build with werft instead of GHA
Run Leeway with
--dont-testPublish
Installer
Add desired feature flags to the end of the line above, space separated
Preview Environment / Integration Tests
If enabled this will build
install/previewIf enabled this will create the environment on GCE infra
Saves cost. Untick this only if you're really sure you need a non-preemtible machine.
Valid options are
all,workspace,webapp,ide,jetbrains,vscode,ssh. If enabled,with-previewandwith-large-vmwill be enabled./hold